package com.labofjet.repository.module2;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;

import com.labofjet.entity.House;

@Repository
public class HouseRepository {
    
    @Resource
    private SessionFactory sessionFactory;
    
    public void save(House s) {
        sessionFactory.getCurrentSession().save(s);
    }
    
    public void deleteAll() {
        sessionFactory.getCurrentSession().createQuery("delete from House").executeUpdate();
    }
}
